<%-- 
    Document   : affirm
    Created on : 2009-01-25, 13:27:38
    Author     : MWaledziak
--%>


<%@page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.sql.ResultSet" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<fmt:setBundle basename="pl.wat.main.Properties" var="bundle" scope="session"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
        <link rel="stylesheet" href="style.css" type="text/css">
        <title>SQL2chart Application</title>
        <script type="text/javascript" >
            <!--

            obrazek1=new Image
            obrazek2=new Image
            obrazek3=new Image
            obrazek4=new Image
            obrazek5=new Image
            obrazek6=new Image
            obrazek7=new Image
            obrazek8=new Image
            obrazek9=new Image
            obrazek10=new Image
            obrazek11=new Image
            obrazek12=new Image
            obrazek13=new Image
            obrazek14=new Image
            obrazek15=new Image
            obrazek16=new Image
            obrazek17=new Image
            obrazek18=new Image

            obrazek1.src='img/AreaChart.png'
            obrazek2.src='img/BarChart.png'
            obrazek3.src='img/BarChart3D.png'
            obrazek4.src='img/LineChart.png'
            obrazek5.src='img/LineChart3D.png'
            obrazek6.src='img/StackedAreaChart.png'
            obrazek7.src='img/StackedBarChart.png'
            obrazek8.src='img/StackedBarChart3D.png'
            obrazek9.src='img/WaterfallChart.png'
            obrazek10.src='img/PieChart.png'
            obrazek11.src='img/PieChart3D.png'
            obrazek12.src='img/RingChart.png'
            obrazek13.src='img/ScatterPlot.png'
            obrazek14.src='img/TimeSeriesChart.png'
            obrazek15.src='img/XYAreaChart.png'
            obrazek16.src='img/XYLineChart.png'
            obrazek17.src='img/XYStepAreaChart.png'
            obrazek18.src='img/XYStepChart.png'

            function sprawdzListe() {
                switch(document.listyFormularz.type.options[document.listyFormularz.type.selectedIndex].text){
                    case 'AreaChart':
                        document.rysunek.src = obrazek1.src;
                        break;
                    case 'BarChart':
                        document.rysunek.src = obrazek2.src;
                        break;
                    case 'BarChart3D':
                        document.rysunek.src = obrazek3.src;
                        break;
                    case 'LineChart':
                        document.rysunek.src = obrazek4.src;
                        break;
                    case 'LineChart3D':
                        document.rysunek.src = obrazek5.src;
                        break;
                    case 'StackedAreaChart':
                        document.rysunek.src = obrazek6.src;
                        break;
                    case 'StackedBarChart':
                        document.rysunek.src = obrazek7.src;
                        break;
                    case 'StackedBarChart3D':
                        document.rysunek.src = obrazek8.src;
                        break;
                    case 'WaterfallChart':
                        document.rysunek.src = obrazek9.src;
                        break;
                    case 'PieChart':
                        document.rysunek.src = obrazek10.src;
                        break;
                    case 'PieChart3D':
                        document.rysunek.src = obrazek11.src;
                        break;
                    case 'RingChart':
                        document.rysunek.src = obrazek12.src;
                        break;
                    case 'ScatterPlot':
                        document.rysunek.src = obrazek13.src;
                        break;
                    case 'TimeSeriesChart':
                        document.rysunek.src = obrazek14.src;
                        break;
                    case 'XYAreaChart':
                        document.rysunek.src = obrazek15.src;
                        break;
                    case 'XYLineChart':
                        document.rysunek.src = obrazek16.src;
                        break;
                    case 'XYStepAreaChart':
                        document.rysunek.src = obrazek17.src;
                        break;
                    case 'XYStepChart':
                        document.rysunek.src = obrazek18.src;
                        break;
                }
            }
            //-->
        </script>
    </head>
    <body>
        <form name="listyFormularz" action="ActionController" method="post">
        <!--<input type="hidden" name="action" value="login"/> -->

            <table align="center">
                <tr>
                    <th colspan="2">
<%                      String querry = (String) request.getSession().getAttribute("que");
                        if(querry != null && !querry.equals("")){
%>Zatwierdziłeś zapytanie: <font color="red"><%=querry%></font>
<%
                        }
%>
                    </th>
                </tr>
                 <tr>
                    <td>
                        
                    </td>
                    <td>

                    </td>
                </tr>
                <tr>
                    <td>
                        Wybierz typ wykresu:
                    </td>
                    <td>
                          <select name="type" size="1" onchange="sprawdzListe();">
                                <option>AreaChart</option>
                                <option>BarChart</option>
                                <option>BarChart3D</option>
                                <option>LineChart</option>
                                <option>LineChart3D</option>
                                <option>StackedAreaChart</option>
                                <option>StackedBarChart</option>
                                <option>StackedBarChart3D</option>
                                <option>WaterfallChart</option>
                                <option>PieChart</option>
                                <option>PieChart3D</option>
                                <option>RingChart</option>
                                <option>ScatterPlot</option>
                                <option>TimeSeriesChart</option>
                                <option>XYAreaChart</option>
                                <option>XYLineChart</option>
                                <option>XYStepAreaChart</option>
                                <option>XYStepChart</option>
                          </select>

                    </td>
                </tr>
                 <tr>
                     <td>
                        Tytuł wykresu:
                     </td>
                     <td>
                        <input type="text" name="title">
                    </td>
                </tr>
                <tr>
                     <td>
                        Opis osi X:
                     </td>
                     <td>
                        <input type="text" name="X">
                    </td>
                </tr>
                <tr>
                     <td>
                        Opis osi Y:
                     </td>
                     <td>
                        <input type="text" name="Y">
                    </td>
                </tr>
                <tr>
                     <td>
                        Orientacja wykresu:
                     </td>
                     <td>
                        <select name="orient" size="1">
                            <option>Pionowa</option>
                            <option>Pozioma</option>
                        </select>
                    </td>
                </tr>
               <tr>
                     <td>
                        Czy dołączyć legendę:
                     </td>
                     <td>
                        <select name="legend" size="1">
                            <option>Tak</option>
                            <option>Nie</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <input type="submit" name="generate" value="Generuj">
                    </td>
                </tr>
            </table>
        </form>
        <img src="img/AreaChart.png" name="rysunek"/>

    </body>
</html>